<template>
  <div class="content" @click="itemClick">
    <div class="img"></div>
    <div class="top">{{ item.top }}</div>
  </div>
</template>

<script setup>
const props = defineProps({
  item: {
    type: Object,
  },
  index: {
    type: Number,
  },
  color: {
    type: String,
  },
  x: {
    type: String,
  },
  y: {
    type: String,
  },
});

const emit = defineEmits(["click"]);

const itemClick = () => {
  emit("click", props.index);
};
</script>

<style lang="less" scoped>
.content {
  .img {
    width: 50px;
    height: 50px;
    margin: 10px auto;
    border-radius: 50%;
    background: url(@/assets/img/indices-icon.png);
    background-repeat: no-repeat;
    background-size: 438px;
    background-color: v-bind("props.color");
    background-position: v-bind("props.x") v-bind("props.y");
  }
  .top {
    text-align: center;
  }
}
</style>